package com.ctgu.蓝桥杯真题.B组2019;

import java.io.*;
import java.util.HashSet;

/**
 * @author: Backdiy
 * @data: 2021/4/8 21:04
 * @desc:
 */
public class B不同子串 {
    public static void main(String[] args) {
        HashSet<String> strings = new HashSet<>();
        String s = new String("0100110001010001");
        for (int i = 0; i < s.length(); i++) {
            for (int j = i; j < s.length(); j++) {
                strings.add(s.substring(i,j+1));
            }
        }
        Input.out.println(strings.size());
        Input.out.flush();
    }
    static class Input {
        static StreamTokenizer streamTokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        static PrintWriter out = new PrintWriter((new OutputStreamWriter(System.out)));
        static BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

        static int nextInt() throws IOException {
            streamTokenizer.nextToken();
            return (int) streamTokenizer.nval;
        }

        static double nextDouble() throws IOException {
            streamTokenizer.nextToken();
            return streamTokenizer.nval;
        }

        static long nextLong() throws IOException {
            streamTokenizer.nextToken();
            return (long) streamTokenizer.nval;
        }

        static String nextLine() throws IOException {
            return bufferedReader.readLine();
        }

        static char next() throws IOException {
            return (char) bufferedReader.read();
        }
    }
}
